Integrand size = 21, antiderivative size = 276 \[ \int \sin ^2(c+d x) (a+b \tan (c+d x))^n \, dx=-\frac {\left (a b^2 n+\sqrt {-b^2} \left (a^2+b^2 (1+n)\right )\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{4 b \left (a^2+b^2\right ) \left (a-\sqrt {-b^2}\right ) d (1+n)}-\frac {\left (a b^2 n-\sqrt {-b^2} \left (a^2+b^2 (1+n)\right )\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right ) (a+b \tan (c+d x))^{1+n}}{4 b \left (a^2+b^2\right ) \left (a+\sqrt {-b^2}\right ) d (1+n)}-\frac {\cos ^2(c+d x) (b+a \tan (c+d x)) (a+b \tan (c+d x))^{1+n}}{2 \left (a^2+b^2\right ) d} \]
-1/4*hypergeom([1, 1+n],[2+n],(a+b*tan(d*x+c))/(a+(-b^2)^(1/2)))*(a*b^2*n- (a^2+b^2*(1+n))*(-b^2)^(1/2))*(a+b*tan(d*x+c))^(1+n)/b/(a^2+b^2)/d/(1+n)/( a+(-b^2)^(1/2))-1/4*hypergeom([1, 1+n],[2+n],(a+b*tan(d*x+c))/(a-(-b^2)^(1 /2)))*(a*b^2*n+(a^2+b^2*(1+n))*(-b^2)^(1/2))*(a+b*tan(d*x+c))^(1+n)/b/(a^2 +b^2)/d/(1+n)/(a-(-b^2)^(1/2))-1/2*cos(d*x+c)^2*(b+a*tan(d*x+c))*(a+b*tan( d*x+c))^(1+n)/(a^2+b^2)/d
Time = 1.33 (sec) , antiderivative size = 270, normalized size of antiderivative = 0.98 \[ \int \sin ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\frac {\left (\left (a^3 \sqrt {-b^2}+a^2 b^2 (-1+n)-b^4 (1+n)-a \left (-b^2\right )^{3/2} (1+2 n)\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right )-\left (a^3 \sqrt {-b^2}-a^2 b^2 (-1+n)+b^4 (1+n)-a \left (-b^2\right )^{3/2} (1+2 n)\right ) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right )+2 b \left (a^2+b^2\right ) (1+n) \cos (c+d x) (b \cos (c+d x)+a \sin (c+d x))\right ) (a+b \tan (c+d x))^{1+n}}{4 b \left (a^2+b^2\right ) \left (-a+\sqrt {-b^2}\right ) \left (a+\sqrt {-b^2}\right ) d (1+n)} \]
(((a^3*Sqrt[-b^2] + a^2*b^2*(-1 + n) - b^4*(1 + n) - a*(-b^2)^(3/2)*(1 + 2 *n))*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x])/(a - Sqrt[-b^ 2])] - (a^3*Sqrt[-b^2] - a^2*b^2*(-1 + n) + b^4*(1 + n) - a*(-b^2)^(3/2)*( 1 + 2*n))*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x])/(a + Sqr t[-b^2])] + 2*b*(a^2 + b^2)*(1 + n)*Cos[c + d*x]*(b*Cos[c + d*x] + a*Sin[c + d*x]))*(a + b*Tan[c + d*x])^(1 + n))/(4*b*(a^2 + b^2)*(-a + Sqrt[-b^2]) *(a + Sqrt[-b^2])*d*(1 + n))
Time = 0.48 (sec) , antiderivative size = 281, normalized size of antiderivative = 1.02, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 3999, 602, 25, 27, 657, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sin ^2(c+d x) (a+b \tan (c+d x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin (c+d x)^2 (a+b \tan (c+d x))^ndx\) |
\(\Big \downarrow \) 3999 |
\(\displaystyle \frac {b \int \frac {b^2 \tan ^2(c+d x) (a+b \tan (c+d x))^n}{\left (\tan ^2(c+d x) b^2+b^2\right )^2}d(b \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 602 |
\(\displaystyle \frac {b \left (-\frac {\int -\frac {b^2 (a+b \tan (c+d x))^n \left (a^2+b n \tan (c+d x) a+b^2 (n+1)\right )}{\tan ^2(c+d x) b^2+b^2}d(b \tan (c+d x))}{2 b^2 \left (a^2+b^2\right )}-\frac {\left (a b \tan (c+d x)+b^2\right ) (a+b \tan (c+d x))^{n+1}}{2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {b \left (\frac {\int \frac {b^2 (a+b \tan (c+d x))^n \left (a^2+b n \tan (c+d x) a+b^2 (n+1)\right )}{\tan ^2(c+d x) b^2+b^2}d(b \tan (c+d x))}{2 b^2 \left (a^2+b^2\right )}-\frac {\left (a b \tan (c+d x)+b^2\right ) (a+b \tan (c+d x))^{n+1}}{2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {b \left (\frac {\int \frac {(a+b \tan (c+d x))^n \left (a^2+b n \tan (c+d x) a+b^2 (n+1)\right )}{\tan ^2(c+d x) b^2+b^2}d(b \tan (c+d x))}{2 \left (a^2+b^2\right )}-\frac {\left (a b \tan (c+d x)+b^2\right ) (a+b \tan (c+d x))^{n+1}}{2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 657 |
\(\displaystyle \frac {b \left (\frac {\int \left (\frac {\left (\sqrt {-b^2} \left (a^2+b^2 (n+1)\right )-a b^2 n\right ) (a+b \tan (c+d x))^n}{2 b^2 \left (\sqrt {-b^2}-b \tan (c+d x)\right )}+\frac {\left (a n b^2+\sqrt {-b^2} \left (a^2+b^2 (n+1)\right )\right ) (a+b \tan (c+d x))^n}{2 b^2 \left (b \tan (c+d x)+\sqrt {-b^2}\right )}\right )d(b \tan (c+d x))}{2 \left (a^2+b^2\right )}-\frac {\left (a b \tan (c+d x)+b^2\right ) (a+b \tan (c+d x))^{n+1}}{2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b \left (\frac {-\frac {\left (\sqrt {-b^2} \left (a^2+b^2 (n+1)\right )+a b^2 n\right ) (a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a-\sqrt {-b^2}}\right )}{2 b^2 (n+1) \left (a-\sqrt {-b^2}\right )}-\frac {\left (a b^2 n-\sqrt {-b^2} \left (a^2+b^2 (n+1)\right )\right ) (a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a+\sqrt {-b^2}}\right )}{2 b^2 (n+1) \left (a+\sqrt {-b^2}\right )}}{2 \left (a^2+b^2\right )}-\frac {\left (a b \tan (c+d x)+b^2\right ) (a+b \tan (c+d x))^{n+1}}{2 \left (a^2+b^2\right ) \left (b^2 \tan ^2(c+d x)+b^2\right )}\right )}{d}\) |
(b*(-1/2*((a + b*Tan[c + d*x])^(1 + n)*(b^2 + a*b*Tan[c + d*x]))/((a^2 + b ^2)*(b^2 + b^2*Tan[c + d*x]^2)) + (-1/2*((a*b^2*n + Sqrt[-b^2]*(a^2 + b^2* (1 + n)))*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x])/(a - Sqr t[-b^2])]*(a + b*Tan[c + d*x])^(1 + n))/(b^2*(a - Sqrt[-b^2])*(1 + n)) - ( (a*b^2*n - Sqrt[-b^2]*(a^2 + b^2*(1 + n)))*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x])/(a + Sqrt[-b^2])]*(a + b*Tan[c + d*x])^(1 + n))/( 2*b^2*(a + Sqrt[-b^2])*(1 + n)))/(2*(a^2 + b^2))))/d
3.1.85.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[(x_)^(m_)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbo l] :> With[{Qx = PolynomialQuotient[x^m, a + b*x^2, x], e = Coeff[Polynomia lRemainder[x^m, a + b*x^2, x], x, 0], f = Coeff[PolynomialRemainder[x^m, a + b*x^2, x], x, 1]}, Simp[(-(c + d*x)^(n + 1))*(a + b*x^2)^(p + 1)*((a*(d*e - c*f) + (b*c*e + a*d*f)*x)/(2*a*(p + 1)*(b*c^2 + a*d^2))), x] + Simp[1/(2 *a*(p + 1)*(b*c^2 + a*d^2)) Int[(c + d*x)^n*(a + b*x^2)^(p + 1)*ExpandToS um[2*a*(p + 1)*(b*c^2 + a*d^2)*Qx + e*(b*c^2*(2*p + 3) + a*d^2*(n + 2*p + 3 )) - a*c*d*f*n + d*(b*c*e + a*d*f)*(n + 2*p + 4)*x, x], x], x]] /; FreeQ[{a , b, c, d, n}, x] && IGtQ[m, 1] && LtQ[p, -1] && NeQ[b*c^2 + a*d^2, 0]
Int[(((d_.) + (e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))^(n_.))/((a_) + (c_.)*( x_)^2), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*((f + g*x)^n/(a + c*x^ 2)), x], x] /; FreeQ[{a, c, d, e, f, g, m}, x] && IntegersQ[n]
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ ), x_Symbol] :> Simp[b/f Subst[Int[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/2]
\[\int \left (\sin ^{2}\left (d x +c \right )\right ) \left (a +b \tan \left (d x +c \right )\right )^{n}d x\]
\[ \int \sin ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sin \left (d x + c\right )^{2} \,d x } \]
\[ \int \sin ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{n} \sin ^{2}{\left (c + d x \right )}\, dx \]
\[ \int \sin ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sin \left (d x + c\right )^{2} \,d x } \]
\[ \int \sin ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\int { {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \sin \left (d x + c\right )^{2} \,d x } \]
Timed out. \[ \int \sin ^2(c+d x) (a+b \tan (c+d x))^n \, dx=\int {\sin \left (c+d\,x\right )}^2\,{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n \,d x \]